<?php

class States_PageStage {
	private static $instancia;

	/**
	 * @var State
	 */
	private static $state;

	/**
	 * @return States_PageStage
	 */
	public static function GetInstancia(){
		if(!self::$instancia){
			self::$instancia = new States_PageStage();
		}

		return self::$instancia;
	}

	public function GetState(){
		if(self::$instancia){
			if(self::$state){
				return self::$state->ReturnState();
			}else{
				return false;
			}
		}else{
			die("Nenhum state configurando");
		}
	}

	public function SetValido(){
		self::$state = new States_States_StateValido();
	}

	public function SetInvalido(){
		self::$state = new States_States_StateInvalido();
	}

	public function __contruct(){
		self::$state = new States_States_StateInvalido();
	}
}